//
//  GZApplyConnectView .swift
//  GLUZ
//
//  Created by lemon on 2025/3/11.
//

import UIKit

class GZApplyConnectView: UIView {
    
    var host: ZegoUIKitUser? {
        didSet {
            guard let host = host else {
                return
            }
            self.setHeadUserName(host.userName ?? "")
        }
    }
    lazy var firstListView: GZApplyConnectListView = {
        let firstView = GZApplyConnectListView()
        return firstView
    }()
    lazy var secondListView: GZApplyConnectListView = {
        let secondView = GZApplyConnectListView()
        return secondView
    }()
    lazy var thirdListView: GZApplyConnectListView = {
        let thirdView = GZApplyConnectListView()
        return thirdView
    }()
    override init(frame: CGRect) {
        super.init(frame: frame)
        self.backgroundColor = UIColor.clear
        self.addSubview(self.firstListView)
        self.addSubview(self.secondListView)
        self.addSubview(self.thirdListView)
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    override func layoutSubviews() {
        super.layoutSubviews()
        self.setupLayout()
    }
    
    func setupLayout() {
        self.firstListView.frame = CGRect(x: 0, y: 0, width: 90, height: 90)
        self.secondListView.frame = CGRect(x: 0, y: 100, width: 90, height: 90)
        self.thirdListView.frame = CGRect(x: 0, y: 200, width: 90, height: 90)
    }
    
    private func setHeadUserName(_ userName: String) {
//        if userName.count > 0 {
//            let firstStr: String = String(userName[userName.startIndex])
//        }
    }
    
}

